Integrand size = 31, antiderivative size = 81 \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=\frac {1}{2} (b B+a (2 A+C)) x-\frac {(A b+a B+b C) \cos (c+d x)}{d}+\frac {b C \cos ^3(c+d x)}{3 d}-\frac {(b B+a C) \cos (c+d x) \sin (c+d x)}{2 d} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.40, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {3102, 2813} \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=-\frac {\cos (c+d x) \left (a (3 b B-a C)+b^2 (3 A+2 C)\right )}{3 b d}+\frac {1}{2} x (a (2 A+C)+b B)-\frac {(3 b B-a C) \sin (c+d x) \cos (c+d x)}{6 d}-\frac {C \cos (c+d x) (a+b \sin (c+d x))^2}{3 b d} \]
[In]
[Out]
Rule 2813
Rule 3102
Rubi steps \begin{align*} \text {integral}& = -\frac {C \cos (c+d x) (a+b \sin (c+d x))^2}{3 b d}+\frac {\int (a+b \sin (c+d x)) (b (3 A+2 C)+(3 b B-a C) \sin (c+d x)) \, dx}{3 b} \\ & = \frac {1}{2} (b B+a (2 A+C)) x-\frac {\left (b^2 (3 A+2 C)+a (3 b B-a C)\right ) \cos (c+d x)}{3 b d}-\frac {(3 b B-a C) \cos (c+d x) \sin (c+d x)}{6 d}-\frac {C \cos (c+d x) (a+b \sin (c+d x))^2}{3 b d} \\ \end{align*}
Time = 0.28 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.14 \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=\frac {6 b B c+6 a c C+12 a A d x+6 b B d x+6 a C d x-3 (4 A b+4 a B+3 b C) \cos (c+d x)+b C \cos (3 (c+d x))-3 b B \sin (2 (c+d x))-3 a C \sin (2 (c+d x))}{12 d} \]
[In]
[Out]
Time = 1.13 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.99
method | result | size |
parts | \(x a A -\frac {\left (A b +B a \right ) \cos \left (d x +c \right )}{d}+\frac {\left (B b +a C \right ) \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {C b \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3 d}\) | \(80\) |
parallelrisch | \(\frac {\left (-3 B b -3 a C \right ) \sin \left (2 d x +2 c \right )+b C \cos \left (3 d x +3 c \right )+\left (\left (-12 A -9 C \right ) b -12 B a \right ) \cos \left (d x +c \right )+\left (6 d x B -12 A -8 C \right ) b +12 a \left (d x A +\frac {1}{2} C d x -B \right )}{12 d}\) | \(89\) |
risch | \(x a A +\frac {x B b}{2}+\frac {x a C}{2}-\frac {\cos \left (d x +c \right ) A b}{d}-\frac {\cos \left (d x +c \right ) B a}{d}-\frac {3 \cos \left (d x +c \right ) C b}{4 d}+\frac {b C \cos \left (3 d x +3 c \right )}{12 d}-\frac {\sin \left (2 d x +2 c \right ) B b}{4 d}-\frac {\sin \left (2 d x +2 c \right ) a C}{4 d}\) | \(103\) |
derivativedivides | \(\frac {-\frac {C b \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}+B b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-A b \cos \left (d x +c \right )-B a \cos \left (d x +c \right )+a A \left (d x +c \right )}{d}\) | \(104\) |
default | \(\frac {-\frac {C b \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}+B b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-A b \cos \left (d x +c \right )-B a \cos \left (d x +c \right )+a A \left (d x +c \right )}{d}\) | \(104\) |
norman | \(\frac {\left (a A +\frac {1}{2} B b +\frac {1}{2} a C \right ) x +\left (a A +\frac {1}{2} B b +\frac {1}{2} a C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A +\frac {3}{2} B b +\frac {3}{2} a C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A +\frac {3}{2} B b +\frac {3}{2} a C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (B b +a C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {6 A b +6 B a +4 C b}{3 d}-\frac {\left (B b +a C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (2 A b +2 B a \right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (4 A b +4 B a +4 C b \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(224\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.88 \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=\frac {2 \, C b \cos \left (d x + c\right )^{3} + 3 \, {\left ({\left (2 \, A + C\right )} a + B b\right )} d x - 3 \, {\left (C a + B b\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 6 \, {\left (B a + {\left (A + C\right )} b\right )} \cos \left (d x + c\right )}{6 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 189 vs. \(2 (73) = 146\).
Time = 0.14 (sec) , antiderivative size = 189, normalized size of antiderivative = 2.33 \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=\begin {cases} A a x - \frac {A b \cos {\left (c + d x \right )}}{d} - \frac {B a \cos {\left (c + d x \right )}}{d} + \frac {B b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {B b x \cos ^{2}{\left (c + d x \right )}}{2} - \frac {B b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {C a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {C a x \cos ^{2}{\left (c + d x \right )}}{2} - \frac {C a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} - \frac {C b \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {2 C b \cos ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\left (c \right )}\right ) \left (A + B \sin {\left (c \right )} + C \sin ^{2}{\left (c \right )}\right ) & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.26 \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=\frac {12 \, {\left (d x + c\right )} A a + 3 \, {\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} C a + 3 \, {\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} B b + 4 \, {\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} C b - 12 \, B a \cos \left (d x + c\right ) - 12 \, A b \cos \left (d x + c\right )}{12 \, d} \]
[In]
[Out]
none
Time = 0.34 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.94 \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=\frac {1}{2} \, {\left (2 \, A a + C a + B b\right )} x + \frac {C b \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {{\left (4 \, B a + 4 \, A b + 3 \, C b\right )} \cos \left (d x + c\right )}{4 \, d} - \frac {{\left (C a + B b\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} \]
[In]
[Out]
Time = 14.10 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.15 \[ \int (a+b \sin (c+d x)) \left (A+B \sin (c+d x)+C \sin ^2(c+d x)\right ) \, dx=-\frac {6\,A\,b\,\cos \left (c+d\,x\right )+6\,B\,a\,\cos \left (c+d\,x\right )+\frac {9\,C\,b\,\cos \left (c+d\,x\right )}{2}-\frac {C\,b\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {3\,B\,b\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {3\,C\,a\,\sin \left (2\,c+2\,d\,x\right )}{2}-6\,A\,a\,d\,x-3\,B\,b\,d\,x-3\,C\,a\,d\,x}{6\,d} \]
[In]
[Out]